package com.zzptc.zzsgz.bdsjws.activities;

import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.zzptc.zzsgz.bdsjws.utils.MyUtil;

public class LoginActivity extends AppCompatActivity {
//没有布局的Activity不用继承基类
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //共享首选项来做判断   获取值XML
      //  SharedPreferences sharedPreferences=getSharedPreferences("welcome", Context.MODE_PRIVATE);//第一个参数写XML的文件名，注意不要后缀
        SharedPreferences sharedPreferences= MyUtil.getSharedPre();
        boolean bool=sharedPreferences.getBoolean("wel",false);
        if(bool){
            //进入欢迎页面
            Intent intent=new Intent(this,WelcomeActivity.class);
            startActivity(intent);
        }else{
            //进入引导页面
            startActivity(new Intent(this,GuideActivity.class));
        }
       finish();

    }


}
